<#include '/pages/taglib/core.ftl'>
<#include "/pages/taglib/common.ftl">

<div class="topMenu">
<ul class="jheadermenu nav topnav">
<#assign menuData=fn.service('espirit.eap.manager.menu').searchMenuList(3)>
<#list menuData as menuItem>
	<li class="tab">
		<a class="tab-name" href="javascript:void(0)" onclick="showMenu(event, this)"><span><@i18n name=menuItem.text/></span></a>
		<#if menuItem.children?size gt 0>
			<ul class="menu show" <#if ! menuItem.children[0].href??>style="width:${menuItem.children?size*100}px"</#if>>
			<#list menuItem.children as childItem>
				<#if childItem.href??>
					<li><a href="javascript:void(0)" onclick="selectMenu(this,'${childItem.href}','${childItem.i18n!}','${childItem.text}')">${childItem.text}</a></li>
				<#else>
					<div style="width:100px;float:left">
					<#list childItem.children as subChildItem>
						<li><a href="javascript:void(0)" onclick="selectMenu(this,'${subChildItem.href!''}','${subChildItem.i18n!''}','${subChildItem.text}')">${subChildItem.text}</a></li>
					</#list>
					</div>
				</#if>
			</#list>
			</ul>
		</#if>
	</li>
</#list>
</ul>
<span id="headClose"></span>
<ul class="jheadermenu nav setting topnav">
	<li class="tab">
		<a class="tab-name" href="javascript:void(0)" onclick="showMenu(event, this)" style="white-space: nowrap;"><span>${(fn.service('user').loginUser.code)!}<label class="passport-arrow">▼</label></span></a>
		
		<ul class="menu show">
			<#assign languags = fn.service('i18n').languages>
			<#list languags as language>
				<#assign fieldI18nKey = 'model.espirit.eap.manager.i18n.' + language + 'Name'>
				<li><a href='${fn.link('/espirit/index')}?request_locale=${language}'><@i18n name=fieldI18nKey locale=language/></a></li>
			</#list>
			<li><a id="_changePassword" href="javascript:void(0)" onclick="openMainTab('${fn.link('/espirit/eap/sa/user._changePassword')}','<@i18n name='action.changePassword'/>','action.changePassword');void(0);"><@i18n name="action.changePassword"/></a></li>
			<li><a href='${fn.link('/espirit/eap/sa/user.logout')}'><@i18n name="commons.logout"/></a></li>
		</ul>
	</li>
</ul>
<div style="display: inline-block; float: right; padding:5px 0 0">
	
</div>
<script>
when('fixPlaceholderDefect', function() {
	$('#partItemSearch').attr('placeholder','<@i18n name="header.menu.searchPartItem"/>');
	fixPlaceholderDefect($('#partItemSearch'));
});
</script>
</div>